<template>
  <div>
    <p>count: {{count}}, 当前count为: {{evenOrOdd}}</p>
  </div>
</template>

<script>
import {mapState, mapGetters} from 'vuex'
export default {
  name: 'CounterShow',

  computed: {
    // count () {
    //   return this.$store.state.counter.count
    // },
    ...mapState('counter', ['count']),
    ...mapGetters('counter', ['evenOrOdd']),  // 返回值对象: {evenOrOdd () {return this.$store.getters.evenOrOdd}}
  }
}
</script>

<style scoped>

</style>
